import java.util.Vector;

public class Enemies {
    //窗口飞机最大数量
    private int maxCount;

    //飞机新增速度
    private int planeAddSpeed;

    //飞机移动速度
    private int moveSpeed;

    //开火时间间隔
    private int fireSpeed;

    //存放敌方飞机的数组
    private Vector<Plane> enemyPlanes;

    public int getPlaneAddSpeed() {
        return planeAddSpeed;
    }

    public void setPlaneAddSpeed(int planeAddSpeed) {
        this.planeAddSpeed = planeAddSpeed;
    }

    public int getFireSpeed() {
        return fireSpeed;
    }

    public void setFireSpeed(int fireSpeed) {
        this.fireSpeed = fireSpeed;
    }

    public int getMoveSpeed() {
        return moveSpeed;
    }

    public void setMoveSpeed(int moveSpeed) {
        this.moveSpeed = moveSpeed;
    }

    public Vector<Plane> getEnemyPlanes() {
        return enemyPlanes;
    }

    public void setEnemyPlanes(Vector<Plane> enemyPlanes) {
        this.enemyPlanes = enemyPlanes;
    }

    public Enemies()
    {
        enemyPlanes = new Vector<>();
    }

    public int getMaxCount() {
        return maxCount;
    }

    public void setMaxCount(int maxCount) {
        this.maxCount = maxCount;
    }

    //新增飞机
    public void enemyAdd(int windowWidth)
    {
        int randomID = (int) (Math.random() * 5 + 1);
        Plane plane = new Plane("enemy0" + randomID + ".png");
        plane.setCurrentX((int) (Math.random() * (windowWidth - 200)));
        plane.setCurrentY(0);
        plane.setMoveStep(3);
        plane.setModelWidth(128);
        plane.setModelHeight(128);
        plane.setType(SelfType.PLANE_TYPE_ENEMY); //friend

        enemyPlanes.add(plane);
    }
}
